<input type="password" id="passwd">

<script>
    document.getElementById("passwd").focus();
    eventSender.keyDown('a');
</script>